<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<div class="page_right equipmentpage_right">
    <p class="equipment_rightp">${typeName}&nbsp;&nbsp;${deviceName}&nbsp;&nbsp;${shortCode}</p>
    <c:forEach items="${paramVoList}" var="data" varStatus="status">
        <div class="equipment_query_resultdv">
            <p class="equipment_query_resultp"><span>${status.count}</span>${data.groupName}</p>
            <ul class="equipment_query_resultTitle">
                <li>参数名称</li>
                <li>参数单位</li>
                <li>参数范围</li>
                <li>参数值</li>
                <li>操作</li>
            </ul>
            <c:forEach items="${data.paramList}" var="paramData">
                <ul class="equipment_query_resultContent">
                    <li>${paramData.devparamname}</li>
                    <li>${paramData.devparamunit}</li>
                    <li>${paramData.indevparamval}~${paramData.outdevparamval}</li>
                    <li class="equipment_query_resultval">${paramData.devparamvalue}</li>
                    <li>
                        <a href="javascript:;" class="equipment_query_resultReset" name="${paramData.devparamsetid}">修改参数值</a>
                        <div class="equipment_query_resultResetdv">
                            <input type="text" class="equipment_query_resultResetval">
                            <a href="javascript:;" class="equipment_query_resultResetbtn1">确认</a>
                            <a href="javascript:;" class="equipment_query_resultResetbtn2">取消</a>
                        </div>
                    </li>
                </ul>
            </c:forEach>
        </div>
    </c:forEach>
</div>
<div class="page_line"></div>

<script type="text/javascript">
    //点击修改参数值  确认
     $(".equipment_query_resultResetbtn1").on("click", function(){
         var equipment_query_resultResetval=$(this).parent().find(".equipment_query_resultResetval").val();
         var paramId=$(this).closest("li").find(".equipment_query_resultReset").attr("name");
         if(equipment_query_resultResetval!=""){
             $.ajax({
                 url: "${basePath}v2/factory/param/updateDeviceParam",
                 type: 'POST',
                 data: {"paramId":paramId,"paramVal":equipment_query_resultResetval},
                 error: function (response) {
                     $errorMsg(response);
                 },
                 success: function (ret) {
                     if(ret.result==true){
                         $("[name="+paramId+"]").next(".equipment_query_resultResetdv").css({"transition":"all 0.2s", "left":"200px"});
                         $("[name="+paramId+"]").parents(".equipment_query_resultContent").find(".equipment_query_resultval").text(equipment_query_resultResetval);
                     }else{
                         alert(ret.info);
                     }
                 }
             });
         }
     });
</script>